<?php

namespace app\common\model;

use think\Model;
use traits\model\SoftDelete;

class ClassStudent extends Model
{
    use SoftDelete;
    // 连接数据库名称
    //protected $connection = 'db2';
    // 表名
    protected $name = 'class_student';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'created_at';
    protected $updateTime = false;
    protected $deleteTime = 'deleted_at';

    public function classes()
    {
        return $this->belongsTo(Classes::class);
    }

    public function student()
    {
        return $this->belongsTo(Student::class);
    }
    

}
